package ${packageName};

import java.util.List;
<#if primaryKeyMappers?size &gt; 1>import java.util.Map;
import java.util.HahsMap;</#if>

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class ${prefix}${domain}${surffix} extends SqlMapClientDaoSupport {

	public int insert(${domain} ${domainVarName}) {
		return (Integer)getSqlMapClientTemplate().insert("${domain}.insert", ${domainVarName});
	}

	public void update(${domain} ${domainVarName}) {
		getSqlMapClientTemplate().update("${domain}.update", ${domainVarName});
	}
	
	public void delete(<#list primaryKeyMappers as primaryKeyMapper>${primaryKeyMapper.fieldType} ${primaryKeyMapper.fieldName}<#if primaryKeyMapper_has_next>, </#if></#list>) {
		<#if primaryKeyMappers?size &gt; 1>Map<String, String> params = new HashMap<String, String>();
			<#list primaryKeyMapper as primaryKeyMapper>params.put("${primaryKeyMapper.fieldName}", ${primaryKeyMapper.fieldName});</#list></#if>
		getSqlMapClientTemplate().delete("${domain}.delete", <#if primaryKeyMappers?size &gt; 1>params<#else><#list primaryKeyMappers as primaryKeyMapper>${primaryKeyMapper.fieldName}</#list></#if>);	
	}
	
	public ${domain} select(<#list primaryKeyMappers as primaryKeyMapper>${primaryKeyMapper.fieldType} ${primaryKeyMapper.fieldName}<#if primaryKeyMapper_has_next>, </#if></#list>) {
		<#if primaryKeyMappers?size &gt; 1>Map<String, String> params = new HashMap<String, String>();
			<#list primaryKeyMapper as primaryKeyMapper>params.put("${primaryKeyMapper.fieldName}", ${primaryKeyMapper.fieldName});</#list></#if>
		return (${domain})getSqlMapClientTemplate().queryForObject("${domain}.select", <#if primaryKeyMappers?size &gt; 1>params<#else><#list primaryKeyMappers as primaryKeyMapper>${primaryKeyMapper.fieldName}</#list></#if>);
	}

	@SuppressWarnings("unchecked")
	public List<${domain}> selectList(SearchCondition searchCondition) {
		return getSqlMapClientTemplate().queryForList("${domain}.selectList", searchCondition);
	}
}